Add RS485 mode support for UART2, UART3, UART4, and UART5.#6820
Merged
pelwell merged 2 commits intoraspberrypi:rpi-6.12.yfrom Apr 28, 2025
Merged
Add RS485 mode support for UART2, UART3, UART4, and UART5.#6820pelwell merged 2 commits intoraspberrypi:rpi-6.12.yfrom
pelwell merged 2 commits intoraspberrypi:rpi-6.12.yfrom
Conversation
6by9
reviewed
Apr 28, 2025
Contributor
6by9
left a comment
There was a problem hiding this comment.
Just the one minor comment from me.
arch/arm/boot/dts/overlays/README
Outdated
| parameter, as RTS is required (default off). | ||
| rs485_invert_rts When RS485 mode is enabled, inverts the RTS | ||
| line from active-high (default) to active-low | ||
| (default off). |
Contributor
There was a problem hiding this comment.
I'm not quite sure what you mean by "default off" here. You've already said the default is active-high. Applies to the other instances too.
Contributor
Author
There was a problem hiding this comment.
Thank you :) I meant that "rs485_invert_rts" is default off, but I appreciate that could cause confusion - would it be better if I just removed the last line of rs485_invert_rts on each instance?
Contributor
Author
Thank you - I've amended the potentially confusing documentation in a new commit. |
popcornmix
added a commit
to raspberrypi/firmware
that referenced
this pull request
Apr 28, 2025
kernel: Add driver for the Waveshare DSI-TOUCH series panels See: raspberrypi/linux#6566 kernel: Add support for TI ADS7828/ADS7830 I2C ADCs See: raspberrypi/linux#6819 kernel: Add RS485 mode support for UART2, UART3, UART4, and UART5 See: raspberrypi/linux#6820
popcornmix
added a commit
to raspberrypi/rpi-firmware
that referenced
this pull request
Apr 28, 2025
kernel: Add driver for the Waveshare DSI-TOUCH series panels See: raspberrypi/linux#6566 kernel: Add support for TI ADS7828/ADS7830 I2C ADCs See: raspberrypi/linux#6819 kernel: Add RS485 mode support for UART2, UART3, UART4, and UART5 See: raspberrypi/linux#6820
Contributor
|
FYI Several of the parameters are incorrectly declared and have no effect. See #7177 for fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch adds RS485 mode support for UART2/3/4/5.
This allows the RTS line to be used to drive the OE pin of an RS485 transceiver (i.e. MAX3078E).
I needed this for a project & it would be useful to have in-tree.
The "ctsrts" override is automatically activated, as this is required to enable the RTS line; there are also overrides to invert the RTS signal, and to set the RTS on and off delays to change the RTS timing around data transmission.
I haven't made changes to uart0-overlay.dts or uart1-overlay.dts as the syntax is quite different, I'm guessing this is legacy.
I also haven't made changes to uartX-pi5-overlay.dts as I'm unable to test these due to them being Pi5-only.
Tested and working OK on a CM4 with a pair of MAX3078E transceivers, overrides in /boot/firmware/config.txt as follows:
dtoverlay=uart3,rs485dtoverlay=uart4,rs485Credit to 6by9 for pretty much all of the device tree modifications here.
The associated forum thread is available here:
https://forums.raspberrypi.com/viewtopic.php?p=2311800